feat: tmux-hooks のハードブロックを非ブロックのリマインダーに降格(#111、v0.61.0)#126
Conversation
- run_in_background=true は即許可(native background 実行との衝突解消) - TMUX 外 foreground dev サーバーは exit 0 + 1 行リマインダーへ降格 - npm test / cargo build 等への定常 advisory を削除 - README/i18n/docs の旧ブロック前提記述を更新、挙動テスト 4 件追加 Closes #111
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 770b1f051a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| echo '[Hook] Use: tmux new-session -d -s dev "npm run dev"' >&2 | ||
| echo '[Hook] Then: tmux attach -t dev' >&2 | ||
| exit 2 | ||
| echo '[Hook] Reminder: prefer run_in_background for dev servers (or tmux new-session for a persistent session)' >&2 |
There was a problem hiding this comment.
Use a visible hook response for the reminder
When this PreToolUse hook sees a foreground dev server outside tmux, it writes the reminder to stderr but then falls through to exit 0. In Claude Code command hooks, exit 0 only processes stdout JSON and otherwise keeps output in debug; stderr is fed back for exit 2 or non-zero hook errors per the hooks reference, so the intended non-blocking reminder is silent in real sessions even though the new tests inspect the script's raw stderr. Please return a documented JSON response such as systemMessage/hookSpecificOutput.additionalContext, or another supported non-blocking signal, instead.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR updates the tmux-hooks feature to stop hard-blocking dev server launches outside tmux (exit 2) and instead provide a non-blocking reminder aligned with Claude Code’s native run_in_background support. This reduces friction with background execution while keeping a lightweight nudge for foreground dev servers started outside tmux.
Changes:
- Adjust
tmux-hooksBash hook behavior: allowrun_in_background=truesilently; emit a single stderr reminder (exit 0) only for foreground dev servers outside tmux; remove always-on advisory noise for build/test commands. - Synchronize user-facing descriptions across README, i18n strings, feature metadata, and wizard config mapping docs to reflect the new non-blocking behavior.
- Add/update unit tests to cover the new behavior (background pass-through, foreground reminder, advisory removal, and silence inside tmux) and update fixture expectations from rc 2 → 0.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/test-runtime-hooks.sh | Adds unit coverage for the new tmux-hooks reminder/pass-through behavior. |
| tests/unit/test-hook-fixtures.sh | Updates fixture smoke test to expect non-blocking behavior (rc 0 + reminder text). |
| README.md | Updates hook summary table to reflect the new “non-blocking reminder” semantics. |
| README.en.md | Same as above for English README. |
| i18n/ja/strings.sh | Updates wizard hook label/description to match new behavior (JA). |
| i18n/en/strings.sh | Updates wizard hook label/description to match new behavior (EN). |
| features/tmux-hooks/scripts/check-bash.sh | Implements the new non-blocking reminder logic and removes advisory noise. |
| features/tmux-hooks/feature.json | Updates feature description to reflect reminder behavior instead of blocking. |
| docs/wizard-config-mapping.md | Updates wizard mapping description to match new behavior (JA). |
| docs/wizard-config-mapping.en.md | Updates wizard mapping description to match new behavior (EN). |
| CHANGELOG.md | Adds v0.61.0 entry documenting the behavior change and rationale. |
概要
LLM 性能監査計画 #121 の P2-05(#111)。dev サーバーの TMUX 外実行ハードブロック(exit 2)を撤廃し、ネイティブ background 実行と協調する非ブロックのリマインダーに降格する。
変更内容
run_in_background=trueは即 exit 0(出力なし)— native background 実行の妨害を解消、(2) TMUX 外の foreground dev サーバーは exit 0 + stderr 1 行「prefer run_in_background(永続セッションが必要なら tmux)」、(3) npm test / cargo build / docker 等への「Consider running in tmux」定常 advisory を削除検証
Closes #111